package com.king.mind;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * Node节点
 */
@Getter
@Setter
@ToString
public class Node {

	private String id;

	/**
	 * 宽度通常是固定的值
	 */
	private double width;
	private double height;
	private double x;
	private double y;

	private boolean selected;

	public void setXY(double x, double y) {
		if (this.x == 0) {
			this.x = x;
		}
		if (this.y == 0) {
			this.y = y;
		}
	}

	public void setX(double x) {
		if (this.x == 0) {
			this.x = x;
		} else {
			System.out.println(this);
		}
	}

	public void setY(double y) {
		if (this.y == 0) {
			this.y = y;
		}
	}

}
